<template>
  <div class="draw-a-fish-container">
    <!-- 导航栏 -->
    <nav class="fish-nav">
      <router-link to="/draw-a-fish">draw</router-link>
      <router-link to="/draw-a-fish/tank">tank</router-link>
      <router-link to="/draw-a-fish/rank">rank</router-link>
    </nav>

    <!-- 路由视图 -->
    <router-view />
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

onMounted(() => {
  // 如果访问的是根路径，重定向到绘画页面
  if (router.currentRoute.value.path === '/draw-a-fish') {
    // 保持在绘画页面
  }
})
</script>

<style scoped>
.draw-a-fish-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.fish-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.fish-nav a {
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: bold;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.fish-nav a:hover,
.fish-nav a.router-link-active {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}
</style>

